home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / mg2a_src.zip / SYS / AMIGA / TTYDEF.H < prev    next >
C/C++ Source or Header  |  1988-08-23  |  5KB  |  202 lines

  1. /*
  2.  * Name:    MicroEMACS
  3.  *        Amiga console device virtual terminal header file
  4.  * Version:    MG 2a
  5.  * Last edit:    28-Nov-87 ...!seismo!ut-sally!ut-ngp!mic (mic@emx.cc.utexas.edu)
  6.  * Created:    20-Apr-86 ...!seismo!ut-sally!ut-ngp!mic
  7.  */
  8.  
  9. #define    GOSLING                /* Compile in fancy display. */
  10. #define    TOP_OFFSET    11        /* # raster lines from top of window */
  11.  
  12. #ifndef    NROW
  13. #define    NROW        51        /* Max rows (interlaced screen)      */
  14. #endif
  15.  
  16. #ifndef    NCOL
  17. #define    NCOL        85        /* Max cols (MoreRows, borderless) */
  18. #endif
  19.  
  20. #ifndef LR_BORDER
  21. #define    LR_BORDER (3 + 20)        /* Vertical border size (pixels)  */
  22. #endif
  23.  
  24. #ifndef TB_BORDER
  25. #define    TB_BORDER (TOP_OFFSET + 2)    /* Horizontal border size (pixels)*/
  26. #endif
  27.  
  28. #ifndef    INIT_ROWS
  29. #define    INIT_ROWS 24            /* Desired initial window height  */
  30. #endif
  31.  
  32. #ifndef    INIT_COLS
  33. #define    INIT_COLS 80            /* Desired initial window width      */
  34. #endif
  35.  
  36. /*
  37.  * Function key codes (using 16-bit KEY values)
  38.  */
  39. #define    KFIRST    0x100
  40.  
  41. #define    KUP    0x100
  42. #define    KDOWN    0x101
  43. #define KLEFT    0x102
  44. #define    KRIGHT    0x103
  45.  
  46. #define    KSUP    0x104
  47. #define    KSDOWN    0x105
  48. #define    KSLEFT    0x106
  49. #define    KSRIGHT    0x107
  50.  
  51. #define    KHELP    0x108
  52. #define    KMENU    0x109
  53. #define    KRESIZE    0x10A
  54.  
  55. #define    KF1    0x10C
  56. #define    KF2    0x10D
  57. #define KF3    0x10E
  58. #define    KF4    0x10F
  59. #define KF5    0x110
  60. #define KF6    0x111
  61. #define KF7    0x112
  62. #define KF8    0x113
  63. #define KF9    0x114
  64. #define KF10    0x115
  65.  
  66. #define    KSF1    0x116
  67. #define    KSF2    0x117
  68. #define KSF3    0x118
  69. #define    KSF4    0x119
  70. #define KSF5    0x11A
  71. #define KSF6    0x11B
  72. #define KSF7    0x11C
  73. #define KSF8    0x11D
  74. #define KSF9    0x11E
  75. #define KSF10    0x11F
  76.  
  77. #define    KW___MOUSE    0x120
  78. #define    KW__CMOUSE    0x121
  79. #define    KW_S_MOUSE    0x122
  80. #define    KW_SCMOUSE    0x123
  81. #define    KWA__MOUSE    0x124
  82. #define    KWA_CMOUSE    0x125
  83. #define    KWAS_MOUSE    0x126
  84. #define    KWASCMOUSE    0x127
  85. #define    KM___MOUSE    0x128
  86. #define    KM__CMOUSE    0x129
  87. #define    KM_S_MOUSE    0x12A
  88. #define    KM_SCMOUSE    0x12B
  89. #define    KMA__MOUSE    0x12C
  90. #define    KMA_CMOUSE    0x12D
  91. #define    KMAS_MOUSE    0x12E
  92. #define    KMASCMOUSE    0x12F
  93. #define    KE___MOUSE    0x130
  94. #define    KE__CMOUSE    0x131
  95. #define    KE_S_MOUSE    0x132
  96. #define    KE_SCMOUSE    0x133
  97. #define    KEA__MOUSE    0x134
  98. #define    KEA_CMOUSE    0x135
  99. #define    KEAS_MOUSE    0x136
  100. #define    KEASCMOUSE    0x137
  101.  
  102. #define    KLAST    KEASCMOUSE
  103.  
  104. /*
  105.  * Mouse key encoding stuff...  The bit fields are:
  106.  *
  107.  *           4 3       2       1     0
  108.  *        | where    | ALT | SHIFT | CTRL
  109.  *
  110.  * Where ALT, SHIFT, and CTRL indicate qualifiers, and the 2-bit
  111.  * where field indicates whether the click was (initially) in a window,
  112.  * a mode line, or the echo line.  The mouse functions are smart enough
  113.  * to remap themselves if necessary; we implement these as keys so
  114.  * users can rebind things to their taste.
  115.  */
  116. #define    M_X_ZERO    ' '
  117. #define    M_Y_ZERO    ' '
  118. #define    MQ_OFFSET    0x40
  119. #define    MQ_NOQUAL    0x00
  120. #define    MQ_CTRL        0x01
  121. #define    MQ_SHIFT    0x02
  122. #define    MQ_ALT        0x04
  123. #define    MQ_WINDOW    0x00
  124. #define    MQ_MODE        0x08
  125. #define    MQ_ECHO        0x10
  126. #define    MQ_WHERE(m)    (m & 0x18)    /* get where field */
  127. #define    MQ_QUALS(m)    (m & 0x07)    /* get qualifier field */
  128.  
  129. /*
  130.  * Intuition menu interface.  Each set of menu items kept in a table of
  131.  * MenuBinding structures, which is in turn kept in a table of MenuInfo
  132.  * structures. These tables are indexed via the menu and item numbers to
  133.  * find the internal extended name of the function associated with a
  134.  * certain item.
  135.  */
  136. #define    MN_OFFSET    ' '        /* menu char - ' ' = real code */
  137. struct MenuBinding {
  138.     char    *Command;
  139.     int    (*Function)();
  140. };
  141.  
  142. struct MenuInfo {
  143.     char *Name;            /* name of menu            */
  144.     short NumItems;            /* # of items            */
  145.     struct MenuBinding *Items;    /* item name, internal binding    */
  146. };
  147.  
  148. #define NITEMS(arr) (sizeof(arr) / (sizeof(arr[0])))
  149.  
  150. /*
  151.  * If either MENU, or BROWSER is defined, we need to define
  152.  * DO_MENU to get the code for dealing with menu selections
  153.  * compiled in.
  154.  */
  155.  
  156. #ifdef    MENU
  157. #define    DO_MENU
  158. #else
  159. #ifdef    BROWSER
  160. #define    DO_MENU
  161. #endif    BROWSER
  162. #endif    MENU
  163.  
  164. /*
  165.  * MODE_RENDITION and TEXT_RENDITION determine the way the mode line and
  166.  * text area are rendered (using the SGR sequence).  TEXT_* and MODE_* set
  167.  * the foreground (FG) and background (BG) color to the specified number.
  168.  * If you* #define CHANGE_COLOR, you can redefine these dynamically.
  169.  */
  170.  
  171. #ifndef MODE_RENDITION
  172. #define    MODE_RENDITION 7
  173. #endif
  174.  
  175. #ifndef TEXT_RENDITION
  176. #define    TEXT_RENDITION 0
  177. #endif
  178.  
  179. #ifndef    TEXT_FG
  180. #define TEXT_FG 1
  181. #endif
  182.  
  183. #ifndef TEXT_BG
  184. #define TEXT_BG 0
  185. #endif
  186.  
  187. #ifndef    MODE_FG
  188. #define MODE_FG 1
  189. #endif
  190.  
  191. #ifndef    MODE_BG
  192. #define MODE_BG 0
  193. #endif
  194.  
  195. /*
  196.  * Return the width and height of
  197.  * the default font for a window.
  198.  */
  199.  
  200. #define    FontWidth(w) (w)->RPort->TxWidth
  201. #define    FontHeight(w) (w)->RPort->TxHeight
  202.